<div class="crumb-wrap">
    <div class="crumb-list"><i class="icon-font"></i><a href="<?=site_url('admini')?>">首页</a>
        <span class="crumb-step">&gt;</span><a href="<?=site_url('admini/store/index')?>">商家管理</a>
        <span class="crumb-step">&gt;</span><a href="<?=site_url('admini/suser/index?sid='.$res_store['id'])?>">用户管理</a>
        <span class="crumb-step">&gt;</span><span class="crumb-name">用户修改（<?=$res_store['s_name']?>）</span>
    </div>
</div>
<div class="result-wrap">
    <div class="result-content">
        <form action="<?=site_url('admini/suser/operation')?>" method="post" id="myform" name="myform" enctype="multipart/form-data">
            <table class="insert-tab" width="100%">
                <tbody>
                    <tr width="120">
                        <th><i class="require-red">*</i>登录帐号：</th>
                        <td>
                            <input class="common-text required" id="title" name="username" size="50" value="<?=$res['username']?>" type="text" readonly="readonly" style="background: #f7f7f7">
                        </td>
                    </tr>
                    <tr>
                        <th><i class="require-red">*</i>联系电话：</th>
                        <td>
                            <input class="common-text required" id="title" name="phone" size="50" value="<?=$res['phone']?>" type="text">
                        </td>
                    </tr>
                    <tr>
                        <th><i class="require-red">*</i>备注名称：</th>
                        <td>
                            <input class="common-text required" id="title" name="name" size="50" value="<?=$res['name']?>" type="text">
                        </td>
                    </tr>
                    <th width="120"><i class="require-red">*</i>权限：</th>
                        <td>
                            <select name="permissions" id="catid" class="required">
                                <option value="2">普通用户</option>
                                <option value="1" <?php echo $res['permissions'] == 1 ? 'selected' : ''?>>管理员</option>
                            </select>
                            <span> <i class="require-red">*</i> 店铺只能有一个管理员</span>
                        </td>
                    </tr>
                    <tr>
                        <th></th>
                        <td>
                            <input type="hidden" name="id" value="<?=$res['id']?>">
                            <input type="hidden" name="store_id" value="<?=$res_store['id']?>">
                            <input class="btn btn-primary btn6 mr10" value="提交" type="submit">
                            <input class="btn btn6" onclick="history.go(-1)" value="返回" type="button">
                        </td>
                    </tr>
                </tbody></table>
        </form>
    </div>
</div>

<script>
$('#myform').submit(function() {
    $(this).ajaxSubmit(function(data){
        if(data == 1){
            layer.alert('更新用户成功!',{
                icon:1,
            },function(){
                //alert(1);
                location.href="<?=site_url('admini/suser/index?sid='.$res_store['id'])?>";
            });
        }else{
            layer.alert(data,{
                icon:2,
            });
        }
    })
    return false;
})

</script>